package com.wyx;

import com.bean.BeanOne;
import com.wyx.anno.EnableCommonConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
//@Import(CommonConfig.class)
//@Import(CommonImportSelector.class)
@EnableCommonConfig
public class App {
    public static void main(String[] args) {
        ApplicationContext app = SpringApplication.run(App.class, args);
        try {
            System.out.println(app.getBean(BeanOne.class));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            System.out.println(app.getBean("abc"));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            System.out.println(app.getBean("beanTree"));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            System.out.println(app.getBean("beanFour"));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            System.out.println(app.getBean("beanFive"));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
